package com.tunnel.home.rest;

import org.axe.annotation.ioc.Autowired;
import org.axe.annotation.ioc.Controller;
import org.axe.annotation.mvc.FilterFuckOff;
import org.axe.annotation.mvc.Request;
import org.axe.annotation.mvc.RequestParam;
import org.axe.constant.RequestMethod;

import com.tunnel.common.constant.Constant;
import com.tunnel.home.common.SysConfig;
import com.tunnel.home.server.UserService;

@FilterFuckOff
@Controller(basePath="/tunnel",desc="tunnel终端的一些接口")
public class TunnelRest {
	@Autowired
	private UserService userService;

	@Request(path = "/get_server_ip", method = RequestMethod.POST, desc = "tunnel-server服务器ip")
	public String get_server_ip(
			@RequestParam(name="email",required=true,desc="用户名")String email,
			@RequestParam(name="password",required=true,desc="密码")String password
			) {
		//账号密码校验
		try {
			userService.checkUserAuth(email, password);
		} catch (Exception e) {
			return e.getMessage();
		}
		
		return "SUCCESS"+Constant.SPLIT_FLAG+SysConfig.server_ip();
	}

}
